const mysql = require('mysql-pro');
const co = require('co-mysql');
const configset = require('./config');

let config={};
const env = process.env.NODE_ENV;
if (env === 'production') {
    config = configset.protConfig;
}else{
    config = configset.devConfig;
}
// 连接数据库文件
let conn = new mysql({
  mysql:{
    host: config.dbHost,
    user: config.dbUser,
    password: config.dbPass,
    database: config.dbName,
    timezone: config.timezone
  }
})
console.log(`连接数据库${config.dbHost}:${config.dbPort}/${config.dbName}成功`);
module.exports = conn